﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Reflection;
using System.ComponentModel;

namespace MediaRecommender.Model
{
    //Method to return ["Description Attributes"] from enums currently not in use
    public static class EnumExtensions
    {
        public static string GetDescription(this Enum value)
        {
            FieldInfo fi = value.GetType().GetField(value.ToString());

            DescriptionAttribute[] attributes =
                (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);

            if (attributes != null && attributes.Length > 0)
                return attributes[0].Description;
            else
                return value.ToString();
        }
    }

    //enums
    public enum Sex
    {
        #region Sex
        Male,
        Female
        #endregion
    }

    public enum Genre
    {
        #region Genre
        comedy,             // 0
        romance,            
        sciencefiction,   
        action,
        @short,
        holiday,            // 5
        kids,
        music,
        roadmovie,
        disaster,
        suspense,           // 10
        sportsfilm,
        erotic,
        filmnoir,
        neonoir,
        tvmovie,            // 15
        sport,
        foreign,
        eastern,
        history,
        indie,              // 20
        thriller,
        horror,
        drama,
        adventure,
        fantasy,            // 25
        crime,
        historical,
        animation,
        documentary, 
        western,            // 30
        war, 
        biography,
        family,
        musical,
        mystery,            // 35
        roleplaying,
        shooter,
        racing,
        strategy            // 38
        #endregion
    }

    public enum Platform
    {
        #region Platform
        PC, 
        [DescriptionAttribute("Sony PlayStation 4")]
        SonyPlaystaion4, 
        [DescriptionAttribute("Microsoft Xbox One")] 
        MicrosoftXboxOne, 
        [DescriptionAttribute("Nintendo Wii U")] 
        NintendoWiiU,
        [DescriptionAttribute("Sony PlayStation 3")]
        Playstation3,
        [DescriptionAttribute("Microsoft Xbox 360")]
        MicrosoftXbox360, 
        [DescriptionAttribute("Nintendo Wii")] 
        NintendoWii,
        [DescriptionAttribute("Sony PlayStation 2")]
        Playstation2, 
        MicrosoftXbox,
        [DescriptionAttribute("Nintendo GameCube")]
        NintendoGameCube
        #endregion
    }
}